var api = require('../../utils/api.js');
var app = getApp();
Page({

    /**
     * 页面的初始数据
     */
    data: {
        id:'',
        lists:[]
    },

    /**
     * 生命周期函数--监听页面加载
     */
    onLoad(options) {
        this.setData({
            id:options.id
        })
        this.getallyunyin();
    },
    getallyunyin() {
        var that=this;
        var id=this.data.id;
        api.post({
            url: 'Liucheng/getlistbyid',
            data: {id:id},
            success: data => {
                console.log(data);
                that.setData({

                    lists:data.data
                })
                
            }
        });
    },
    wancehngall(){
        var that=this;
        var id=this.data.id;
        api.post({
            url: 'Liucheng/allsuccess',
            data: {id:id},
            success: data => {
                console.log(data);
                that.getallyunyin();
            }
        });
    },
    wancehngbyid(ret){
        console.log(ret);
        var id=ret.currentTarget.dataset.id;
        var that=this;
        api.post({
            url: 'Liucheng/asuccess',
            data: {id:id},
            success: data => {
                console.log(data);

                wx.showToast({
                  title: data.msg,
                  icon:'none'
                })
                that.getallyunyin();
            }
        });
    },
    seeinfo(ret){
        console.log(ret);
        var id=ret.currentTarget.dataset.id;
        wx.navigateTo({
          url: '/pages/class/info?id='+id
        })

    }
})